package com.zxx.pattern.iteratorPattern.iterator2.old;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zxx on 2021/4/8
 */
public class TVChanneMenu {

    List<MenuItem> menuItems;

    public TVChanneMenu() {
        menuItems = new ArrayList<>();

        addItem(1, "CCTV-1", "this is 1");
        addItem(2, "CDFV-2", "this is 2");
        addItem(3, "CCTV-3", "this is 3");
        addItem(4, "CCTV-4", "this is 4");
        addItem(5, "CCTV-5", "this is 5");
    }

    //将电视频道节目添加菜单集合中
    private void addItem(int channe, String name, String desc) {
        MenuItem item = new MenuItem(name, desc, channe);
        menuItems.add(item);
    }

    public List<MenuItem> getMenuItems() {
        return menuItems;
    }

}
